package com.dfd.common.exception;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Setter
@Getter
@NoArgsConstructor //防止反序列化失败
public class CustomException extends RuntimeException {
    private static final long serialVersionUID = -1896611888647503207L;
    private String msg;
    private int code = 100;


    public CustomException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public CustomException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public CustomException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

}
